$(document).ready(function(){
	$(".itemRows").each(function(idx, item){
		$(item).mouseenter(function(event){
			$(item).css("background-color", "#fdeada");
		}).mouseleave(function(event){
			$(item).css("background-color", "#fff");
		});
	});

	var sysCode = $("input[name='sysCode']").val();
	$(":input[name='fnMgrBtn']").each(function(idx, item){
		$(item).on("click", function(event){
			var fields = $(item).parent("td").parent("tr").find(">td");
			var grpId = $(fields).eq(1).text();
			var grpNm = $(fields).eq(3).text();
			var options = new Object();
			options["url"] = "/template/system/group/_fnMgrForm/"+grpId;
			options["data"] = "sysCode=" + sysCode; 
			options["jqwId"] = "mgrJqwPop";
			options["jqwType"] = "popup";
			options["title"] = "["+grpNm+"] 기능관리";
			options["resizable"] = false;
			options["width"] = "850";
			options["height"] = "505";
			jqwOpen(options);
		});		
	});
		
	$(":input[name='membersBtn']").each(function(idx, item){
		$(item).on("click", function(event){
			var fields = $(item).parent("td").parent("tr").find(">td");
			var grpId = $(fields).eq(1).text();
			var grpNm = $(fields).eq(3).text();
			var options = new Object();
			options["url"] = "/template/system/group/_members/"+grpId;
			options["jqwId"] = "membersJqwPop";
			options["jqwType"] = "popup";
			options["title"] = "["+grpNm+"] 구성원";
			options["resizable"] = false;
			options["width"] = "500";
			options["height"] = "300";
			jqwOpen(options);
		});
	});
	
	$(":input[name='detailBtn']").each(function(idx, item){
		$(item).on("click", function(event){
			var fields = $(item).parent("td").parent("tr").find(">td");
			var grpId = $(fields).eq(1).text();
			var grpNm = $(fields).eq(3).text();
			var options = new Object();
			options["url"] = "/template/system/group/_detail/"+grpId;
			options["jqwId"] = "detailJqwPop";
			options["jqwType"] = "popup";
			options["title"] = "["+grpNm+"] 상세 정보";
			options["resizable"] = false;
			options["width"] = "500";
			options["height"] = "252";
			jqwOpen(options);
		});
	});
		
	$(":input[name='reviseBtn']").each(function(idx, item){
		$(item).on("click", function(event){
			var fields = $(item).parent("td").parent("tr").find(">td");
			var grpId = $(fields).eq(1).text();
			var grpNm = $(fields).eq(3).text();
			var options = new Object();
			options["url"] = "/template/system/group/_regFormRevise/"+grpId;
			options["jqwId"] = "reviseJqwPop";
			options["jqwType"] = "popup";
			options["title"] = "["+grpNm+"] 그룹 수정";
			options["resizable"] = false;
			options["width"] = "500";
			options["height"] = "252";
			jqwOpen(options);
		});
	});
});